package com.richard.cloud.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "t_order")
public class Order implements Serializable{
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	private String orderNo; //订单号
	
	private Long custId; //哪个客户
	
	private Long prodId; //哪个商品
	
	private Integer count; //商品数目
	
	@Column(precision = 11, scale = 2)
	private BigDecimal amount; //总金额
	
	@Column(length = 20)
	private String status; //订单状态，create, finish
	
	private LocalDateTime createTime; // 创建时间
	private LocalDateTime updateTime; // 修改时间
	
	public Order(Long custId, Long prodId, Integer count, BigDecimal amount) {
		super();
		this.custId = custId;
		this.prodId = prodId;
		this.count = count;
		this.amount = amount;
	}
}
